<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>访客</title>
    <link rel="stylesheet" href="css/index.css">
    <link rel="stylesheet" href="css/visitor.css">
</head>
<script type="text/javascript" src="https://repo.bfw.wiki/bfwrepo/js/vanilla-tilt.min.js"></script>
<body>
<div class="head">
    <div class="logo">
        <a href="index.html"><img src="imgs/index/ESDC_logo.jpg" alt=""></a>
        <div class="logo_name">
            <h1>&nbsp;工&nbsp;程&nbsp;软&nbsp;件&nbsp;研&nbsp;发&nbsp;中&nbsp;心</h1>
            <p>&nbsp;Engineering Software Development Centre</p>
        </div>
    </div>
    <div class="top_list">
        <ul>
            <li><a href="visitor.html">访客</a></li>
<!--            <li><a href="">邮箱</a></li>-->
            <li class="dropdown"><a href="">联系我们</a>
                <div class="dropdown-content">
                    <p>电话：123-456-7890</p>
                    <p>邮箱：contact@example.com</p>
                    <p>地址：北京市朝阳区</p>
                </div>
            </li>
            <li id="userProfileBtn" style="display: none;">
                <a href="javascript:void(0);" onclick="showPersonalBox()">用户名</a>
            </li>
            <li id="loginRegisterBtn">
                <a href="javascript:void(0);" onclick="showLoginBox()">登录</a><span>/</span><a href="javascript:void(0);" onclick="showRegistrationBox()">注册</a>
            </li>
        </ul>
    </div>
    <div class="bottom_nav">
        <ul>
            <li><a href="aboutUs.html">关于我们</a></li>
            <li><a href="researchFindings.html">研究成果</a></li>
            <li><a href="newsEvents.html">新闻活动</a></li>
            <li><a href="cooperation.html">合作交流</a></li>
        </ul>
    </div>
    <div class="test"></div>
</div>
<div class="myCanvas" id="myCanvas">
    <canvas></canvas>
</div>
<div class="lead">
    <h1 class="logo-1">来访路线</h1>
    <div class="photo">
        <div class="container">
            <div class="box">
                <h2 class="name">可以看见一个师大雕塑，以它为参照</h2>
                <a href="#" class="buy">校区南门</a>
                <img src="imgs/index/bigCarousel1.jpg" class="product">
            </div>
        </div>
        <div class="container">
            <div class="box">
                <h2 class="name">绕圆盘右转可见双理楼</h2>
                <a href="#" class="buy">双理楼</a>
                <img src="imgs/index/bigCarousel2.jpg" class="product">
            </div>
        </div>
        <div class="container">
            <div class="box">
                <h2 class="name">双理楼的6616工作室就是我们工程软件研发中心</h2>
                <a href="#" class="buy">工程软件研发中心</a>
                <img src="imgs/index/bigCarousel3.jpg" class="product">
            </div>
        </div>
    </div>

</div>
<script src="js/visitor.js"></script>
<script src="js/window.js"></script>
<script>
    VanillaTilt.init(document.querySelectorAll(".box"), {
        max: 25,
        speed: 400,
        glare: true,
        "max-glare":0.5
    });
</script>
<script>
    document.addEventListener('DOMContentLoaded', function() {
        checkLoginStatus(); // 检查登录状态并更新界面
    });

    function checkLoginStatus() {
        const username = localStorage.getItem('username');
        if (username) {
            updateUserInfo(username);
        } else {
            // 如果没有用户名，则显示登录注册按钮
            const loginRegisterBtn = document.getElementById('loginRegisterBtn');
            const userProfileBtn = document.getElementById('userProfileBtn');
            loginRegisterBtn.style.display = 'inline';
            userProfileBtn.style.display = 'none';
        }
    }

    function updateUserInfo(username) {
        const userProfileBtn = document.getElementById('userProfileBtn');
        const loginRegisterBtn = document.getElementById('loginRegisterBtn');

        if (userProfileBtn && loginRegisterBtn) {
            userProfileBtn.querySelector('a').innerText = username;
            userProfileBtn.style.display = 'inline'; // 显示用户名按钮,inline保证不被换行
            loginRegisterBtn.style.display = 'none'; // 隐藏登录注册按钮
        } else {
            console.error('User profile or login register button not found');
        }
    }
</script>

</body>
</html>